package org.okeoe.gen.entity;
/**
 * Created by luodajie on 2019/1/6.
 */

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.okeoe.gen.base.BaseUUID;
import org.okeoe.gen.utils.WheterYN;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.persistence.Version;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * @author :dj
 * @version : 1.0.0
 * @description 表头
 * @Date 2019-01-06 10:26
 * @note
 */
@Data
@Table(name = "cg_form_head")
public class CgFormHead extends BaseUUID {
    /**表描述*/
    @NotNull(message = "表描述不能为空")
    private String content;
    /**同步数据库状态(Y,N)*/
    @Column(name = "is_db_synchronization")
    private String isDbSynchronization = WheterYN.NO.getValue();
    /**表名*/
    @NotBlank(message = "表名不能为空")
    @Column(name = "table_name")
    private String tableName;
    @Column(name = "entity_name")
    private String entityName;
    /**是否分页 ( Y,N) 生成分页*/
    @Column(name = "is_pagination")
    private String isPagination = WheterYN.YES.getValue();
    /**是否分页( Y,N) 生成导出方法*/
    @Column(name = "is_export")
    private String isExport = WheterYN.NO.getValue();
    /**创建时间*/
    @Column(name = "CREATE_DATE")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createDate = new Date();
    /**更新时间*/
    @Column(name = "UPDATE_DATE")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateDate;
    /**生成字段JSON*/
    @NotBlank(message = "字段规则不能为空")
    @Column(name = "DATA_JSON")
    private String dataJson;
    @NotBlank(message = "模块不能为空")
    @Column(name = "MODULE_NAME")
    private String moduleName;
    /**
     * 是否创建用户系统组织
     */
    @Column(name = "IS_CREATE_APP_ORG")
    private String isCreateAppOrg;
    /**
     * 是否是树形结构
     */
    @Column(name = "IS_TREE")
    private String isTree = WheterYN.NO.getValue();
    /**
     * 树形查询名称
     */
    @Column(name = "TREE_SEL_NAME")
    private String treeSelName;
    /**
     * 树形查询名称的SQL字段名
     */
    @Column(name = "TREE_SEL_SQL")
    private String treeSelSql;
    /**
     * 前段页面配置
     */
    @Column(name = "PAGE_CONFIG")
    private String pageConfig;
    /**
     * 代码模板
     */
    @Column(name = "TEMP_GROUP_ID")
    private String tempGroupId;
    @Column(name = "TEMP_GROUP_NAME")
    private String tempGroupName;
    @Version
    private Integer version;
    /**
     * 表类型（main,info，single）
     */
    @Column(name = "TABLE_TYPE")
    private String tableType;
    /**
     * 从表id
     */
    @Column(name = "TABLE_INFO_IDS")
    private String tableInfoIds;  /**
     * 从表名称
     */
    @Column(name = "TABLE_INFO_NAMES")
    private String tableInfoNames;


}
